#include <iostream>
#include <vector>
#include <cmath>
#include "matplotlibcpp.h"

using namespace std;
namespace plt = matplotlibcpp;

void output()
{

}

int main()
{
    std::vector<double> x = {0.5, -0.5, 0.625, -0.625, 0.75, -0.75, 0.875, -0.875, 1, -1 ,1.25, -1.25, 1.5, -1.5, 1.75, -1.75, 2, -2, 2.5, -2.5, 3, -3, 3.5, -3.5, 0};
    std::vector<double> y(25) ;

    //以下为画图部分

    plt::figure();          //创建一张图
    plt::scatter(x,y);

    plt::xlim(-4, 4);
    plt::ylim(-0.2, 0.2);
    plt::title("plot F on real axis"); // set a title

    plt::save("B1.png");

    x.push_back(0.125);
    x.push_back(-0.125);
    x.push_back(0.25);
    x.push_back(-0.25);
    x.push_back(0.375);
    x.push_back(-0.375);

    std::vector<double> z(31) ;

    plt::figure();          //创建一张图
    plt::scatter(x,z);

    plt::xlim(-4, 4);
    plt::ylim(-0.2, 0.2);
    plt::title("plot extended F on real axis"); // set a title

    plt::save("B2.png");

    cout << "B : Plot output success!" << endl;

    return 0;
}